VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsConnection"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'xwelx 04.2010

Option Explicit

Public Property Get cn() As ADODB.Connection
    Set cn = glbCN
End Property

Public Property Set cn(ByVal vNewValue As ADODB.Connection)
    Set glbCN = vNewValue
End Property

Public Property Get cnShape() As ADODB.Connection
    Set cnShape = glbCNShape
End Property

Public Property Set cnShape(ByVal vNewValue As ADODB.Connection)
    Set glbCNShape = vNewValue
End Property

Public Sub OpenConnection(strConnection As String)
    Set cn = New ADODB.Connection
    With cn
        .CursorLocation = adUseClient
        .ConnectionString = strConnection
        .Open
    End With
End Sub

Public Sub OpenShapeConnection(strConnection As String)
    Set cnShape = New ADODB.Connection
    With cnShape
        .CursorLocation = adUseClient
        .ConnectionString = strConnection
        .Open
    End With
End Sub


Public Sub OpenNewConnection(cConn As ADODB.Connection)
    
Dim oString As New clsDeclaration
    Set cConn = Nothing
    Set cConn = New ADODB.Connection
    cConn.CursorLocation = adUseClient
    

    cConn.ConnectionString = "driver={" & oString.DBDriver & "};" & _
    "server=" & oString.Server & ";uid=sa;pwd=" & oString.DBPassword & ";database=" & oString.DBName

    cConn.Open

End Sub
